<?php

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query;

class DefaultDb_Repositories_BranchesUserRepository extends EntityRepository
{

    public function getBranchesPending()
    {
        $em = $this->getEntityManager();
        $query = $em->createQuery('SELECT m FROM DefaultDb_Entities_BranchesUser m WHERE m.point IS NULL');
        return $query->getResult();
    }

    public function getBranchesDistinct()
    {
        $em = $this->getEntityManager();
        $query = $em->createQuery('SELECT DISTINCT bu.id FROM DefaultDb_Entities_BranchesUser bu JOIN bu.client u');
  //      var_dump($query->getSQL()); die;
        return $query->getResult();
    }
}

?>
